<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>无垠式通用代码生成器JEEEU版</title>
<link rel="stylesheet" type="text/css" href="../easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="../easyui/themes/icon.css">
<link rel="stylesheet" type="text/css" href="../easyui/demo/demo.css">
<link href="../lib/codemirror.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../easyui/jquery.min.js"></script>
<script type="text/javascript" src="../easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="../lib/codemirror.js"></script>
<script type="text/javascript" src="../js/sgs.js"></script>
<style type="text/css">
#mycode {
	font-size:14pt;
}
.infinity {
	background:url(../css/images/aurora.png);
   	background-size:20%,20%;
    background-repeat:no-repeat;
    background-position:840px 306px;
    mix-blend-mode:darken;
    background-attachment: fixed; 
}
</style>
</head>
<body class="easyui-layout">
<div data-options="region:'north',border:false" style="height:110px;background:#B3DFDA;padding:8px">
	<h1 style="font-size:16pt;"><a style="text-decoration: none;color:black;" href="https://gitee.com/jerryshensjf/InfinityJEEEU">无垠式通用代码生成器JEEEU版</a></h1><a style="text-decoration: none;color:black;position: absolute;top:30px;left:320px;font-size:10pt;" href="https://gitee.com/jerryshensjf/InfinityJEEEU">官网</a>
	<h2 style="font-size:9pt;"><a style="text-decoration: none;color:black;" href="https://gitee.com/jerryshensjf/InfinityJEEEU">自2014年起为公众服务</a></h2>
</div>
<div data-options="region:'west',split:true,title:'主菜单'" style="width:270px;padding:0px;">
<div class="easyui-accordion" data-options="fit:true,border:false">       						
<div title="功能菜单" style="padding:0px" data-options="selected:true">
<div id="mmadmin" data-options="inline:true" style="width: 250px; height: 98%; overflow:scroll; left: 0px; top: 0px; outline: none; display: block;" class="menu-top menu-inline menu easyui-fluid" tabindex="0"><div class="menu-line" style="height: 122px;"></div>
<div onclick="switchUrl('../html/index.html')" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">脚本生成代码</div><div class="menu-icon icon-add"></div></div>
<div onclick="switchUrl('../html/parseexcel.html')" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">上传生成代码</div><div class="menu-icon icon-add"></div></div>
<div onclick="switchUrl('../html/excelWizard.html')" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">模板向导生成</div><div class="menu-icon icon-add"></div></div>
<div onclick="switchUrl('../html/compare.html')" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">生成差异版本</div><div class="menu-icon icon-add"></div></div>
<div onclick="switchUrl('../html/transformer.html')" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">SGS2模板转换</div><div class="menu-icon icon-add"></div></div>
<div onclick="setFinalSampleDemo()" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">FinalSample示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="setFinalMagicDemo()" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">FinalMagic示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="setCompleteSampleDemo()" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">CompleteSample示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="setCompleteAdvancedDemo()" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">CompleteAdvanced示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="setCompleteOracleEnDemo()" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">CompleteOracleEn示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="setGenerateSampleDemo()" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">GenerateSample示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="setGenerateOracleDemo()" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">GenerateOracle示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="setGenerateOracleAdvancedDemo()" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">Oracle先进特性示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="setGenerateOracleAdvancedEnDemo()" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">GenerateOracleAdvancedEn示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="setGenerateCallMagicDemo()" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">魔法语句示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="setGenerateAdvancedDemo()" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">先进特性示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="setOneDemo()" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">One示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="setEmployeeDemo()" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">EmployeeTest示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="setUserSystemsDemo()" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">用户系统示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="setUserSystemsOraclecDemo()" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">Oracle用户系统示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="setMyAreasDemo()" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">场馆管理系统示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="setMySportsDemo()" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">运动示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="setMyProjectDemo()" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">项目管理示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="setDualLangBBSDemo()" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">DualLangBBS示例</div><div class="menu-icon icon-add"></div></div>
<div onclick="setReadme()" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">阅读说明</div><div class="menu-icon icon-add"></div></div>
<div onclick="window.location='../docs/PeaceWingSMEU_InstallUsage_4_0.docx'" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载安装运行文档</div><div class="menu-icon icon-add"></div></div>
<div onclick="window.location='../docs/PeaceWingSMEU_UserManual_4_0.docx'" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载用户手册</div><div class="menu-icon icon-add"></div></div>
<div onclick="switchUrl('../tools/multiTokenReplacer.html')" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">贴心小工具</div><div class="menu-icon icon-add"></div></div>
<div onclick="switchUrl('../onlinedoc/luantan_index.html')" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">代码生成器技术乱弹</div><div class="menu-icon icon-add"></div></div>
<div onclick="switchUrl('../onlineqa/onlineqa_index.html')" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">在线问答</div><div class="menu-icon icon-add"></div></div>
<div onclick="window.location='../docs/GenerateSampleBackendSMEU_20190415.zip'" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载前后端分离例程</div><div class="menu-icon icon-add"></div></div>
<div onclick="window.location='../docs/Infinity面向棱柱动词算子式通用目的代码生成器详细设计Update3.ppt'" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载原理文档一</div><div class="menu-icon icon-add"></div></div>
<div onclick="window.location='../docs/动词算子式通用目的代码生成器基础理论讲纲Update2.pptx'" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载原理文档二</div><div class="menu-icon icon-add"></div></div>
<div onclick="window.location='../docs/代码生成原理浅析.ppt'" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载原理文档三</div><div class="menu-icon icon-add"></div></div>
<div onclick="window.location='../docs/超级语言.pptx'" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载原理文档四</div><div class="menu-icon icon-add"></div></div>
<div onclick="window.location='../docs/动词算子式代码生成器设计技术理论及实现.pptx'" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载原理文档五</div><div class="menu-icon icon-add"></div></div>
<div onclick="getGift()" class="menu-item" style="height: 20px;"><div class="menu-text" style="height: 20px; line-height: 20px;">下载神秘礼物</div><div class="menu-icon icon-add"></div></div>
</div>
</div>
</div>
</div>
<div data-options="region:'east',split:true,collapsed:true,title:'属性'" style="width:250px;overflow: hidden">
</div>
<div data-options="region:'south',border:false" style="height:50px;background:#A9FACD;padding:10px;text-align: center">火箭船软件工作室版权所有。作者电邮:jerry_shen_sjf@qq.com QQ群:277689737</div>
<div data-options="region:'center',title:'无垠式通用代码生成器JEEEU版功能区'">
<div title="生成结果面板" class="easyui-panel" style="width:1200px;height:140px">
<div style="float:left;font-size:12pt">生成结果:</div><br/><br/>
<div id="generateResults"></div>
<div style="clear:both"></div>
</div>
<div title="标准生成器脚本(SGS)面板" class="easyui-panel infinity" style="width:1200px;height:1000px">
<form id="codeForm" action="" method="post">
<input type="checkbox" id="ignoreWarning" name="ignoreWarning" value="true" checked="false"/>忽略编译警告<br>
<input type="checkbox" id="genFormatted" name="genFormatted" checked value="true" />生成格式化模板<br>
<input type="checkbox" id="generateFront" name="generateFront" checked value="true" />生成前端<br>
<input type="checkbox" id="autoConfig" name="autoConfig" checked value="true" onchange="toggleAutoConfig()"/>根据技术栈自动设置前端基地址<br>
<input type="checkbox" id="frontUseProjectName" name="frontUseProjectName" value="true" checked disabled/>前端API使用项目名<br>
<input type="checkbox" id="frontUseControllerPrefix" name="frontUseControllerPrefix" value="true" checked disabled/>前端基地址使用控制器包名<br>
<input type="checkbox" id="sqlComments" name="sqlComments" checked value="true" />数据库脚本增加注释<br>
<input type="checkbox" id="generateExcel" name="generateExcel" checked value="true" />生成SGS2模板<br>
<input type="checkbox" id="goCompatibility" name="goCompatibility" checked value="true" />使用Go兼容性<br>
<input type="checkbox" id="rustCompatibility" name="rustCompatibility" checked value="true" />使用Rust兼容性<br>

<input type="checkbox" id="useAdvancedCustomize" name="useAdvancedCustomize" value="true" onchange="checkUseCust()"/>后端使用高级定制功能<br>
<div style="font-size:11pt;display:none" id="useCust">
&nbsp;&nbsp;<input type="checkbox" id="genUi" name="genUi" checked value="true" />生成界面
&nbsp;&nbsp;<input type="checkbox" id="genController" name="genController" checked value="true" />生成Controller
&nbsp;&nbsp;<input type="checkbox" id="genService" name="genService" checked value="true" />生成Service
<br>
&nbsp;&nbsp;<input type="checkbox" id="genServiceImpl" name="genServiceImpl" checked value="true" />生成ServiceImpl
&nbsp;&nbsp;<input type="checkbox" id="genDao" name="genDao" checked value="true" />生成Dao
&nbsp;&nbsp;<input type="checkbox" id="genDaoImpl" name="genDaoImpl" checked value="true" />生成Mapper文件
</div>
<input type="checkbox" id="useUserPartial" name="useUserPartial" value="true" onchange="checkUseUserPartial()"/>后端使用部分生成功能<br>
<div style="font-size:11pt;display:none" id="usePartial">
<textarea id="exportStr" name="exportStr" cols="32" rows="4" style="margin-left:20px">
</textarea>
</div>
<br/><br/>
<input type="button" value="生成代码" onclick="submitCode();"/><input type="reset" value="重置"/><br/><br/>
请在下面的文本框里输入您的SGS程序：<br/><br/>
<textarea id="mycode" name="mycode" cols="100" rows="60" style="width:720px">
</textarea><br/>

</form>
</div>
                  

  
</div>
</body>
<script type="text/javascript">
var editor = CodeMirror.fromTextArea($("#mycode")[0],
		{	mode:"text/sgs",indentUnit:4,
			lineNumbers: true
	});
editor.setSize('40em','160em');

$(document).ready(function(){  
	setFinalSampleDemo();
});  

function getGift(){
	var fileArr = ["clocksimplejee4_0_98.zip","TestDemo_allcorrect_20170410.zip"];
	var rand = parseInt(Math.random()*2);
	window.location='../docs/'+fileArr[rand];	
}

function isBlank(val){
	if (val == undefined|| val == null || val == "" || val== "0" || val == 0) return true;
	else return false;
}

function submitCode(){
	$("#generateResults").html("");
	var ignoreWaring = $("#ignoreWarning").get(0).checked;
	$.ajax({
        type: "post",
        url: "../facade/generateSampleCodeFacade",
        data: {code:editor.getValue(),
        		ignoreWarning:ignoreWaring,
        		genFormatted:$("#genFormatted").prop("checked"),
        		generateFront:$("#generateFront").prop("checked"),
        		autoConfig:$("#autoConfig").prop("checked"),
        		frontUseProjectName:$("#frontUseProjectName").prop("checked"),
        		frontUseControllerPrefix:$("#frontUseControllerPrefix").prop("checked"),
        		sqlComments:$("#sqlComments").prop("checked"),
        		generateExcel:$("#generateExcel").prop("checked"),
        		goCompatibility:$("#goCompatibility").prop("checked"),
        		rustCompatibility:$("#rustCompatibility").prop("checked"),
        		
        		useAdvancedCustomize:$("#useAdvancedCustomize").prop("checked"),
        		genUi:$("#genUi").prop("checked"),
        		genController:$("#genController").prop("checked"),
        		genService:$("#genService").prop("checked"),
        		genServiceImpl:$("#genServiceImpl").prop("checked"),
        		genDao:$("#genDao").prop("checked"),
        		genDaoImpl:$("#genDaoImpl").prop("checked"),
        		
        		useUserPartial:$("#useUserPartial").prop("checked"),
        		exportStr:$("#exportStr").val(),
        },
        dataType: 'json',
        success: function(data, textStatus) {
           if (data.success == true){
        	   var resultStr = "<strong>"+data.projectName+"</strong><a href=\"../source/"+data.projectName+".zip\">点击下载后端项目</a><br>";
        	   if (!isBlank(data.frontProjectName)) resultStr += "<strong>"+data.frontProjectName+"</strong><a href=\"../source/"+data.frontProjectName+".zip\">点击下载前端项目</a><br>"
        	   $("#generateResults").html(resultStr);
           }else if (data.success == false){
        	   var resultStr = "<span style='color:red;font-size:16pt''>";
        	   for (var i = 0; i < data.compileErrors.length;i++){
        		   resultStr += data.compileErrors[i];
        		   resultStr += "<br/>"
        	 		  }   
        	   if (data.compileErrors.length > 0) resultStr += "</span>";
        	   resultStr += "<br/><span style='color:#cd740c;font-size:16pt'>";    	   		 
        	   for (var i = 0; i < data.compileWarnings.length;i++){
        		   resultStr += data.compileWarnings[i];
        		   resultStr += "<br/>"
        	 		  }
        	   if (data.compileWarnings.length > 0) resultStr += "</span>";
        	   $("#generateResults").html(resultStr);
           }
        },
        complete : function(XMLHttpRequest, textStatus) {
        
		},
		error : function(XMLHttpRequest,textStatus,errorThrown) {
			//alert("Error:"+textStatus);
			//alert(errorThrown.toString());
		}
    });	
}

function Write2Text(filename)
{
	var fso = new ActiveXObject("Scripting.FileSystemObject");
	var f = fso.CreateTextFile(filename, true);
	for(var i=0;i<arr.length;i++)
	{
	f.write(arr[i])
	f.WriteBlankLines(1)
	}
	f.Close();
}

function setEmployeeDemo(){
	readText("employeetest.sgs")
}

function setMyAreasDemo(){
	readText("myareas.sgs")
}

function setMySportsDemo(){
	readText("mysports.sgs")
}

function readText(myfilename){
	$("#generateResults").html("");
	$.ajax({
        type: "get",
        url: "../facade/readSgsFileFacade",
        data: {filename:myfilename},
        dataType: 'text',
        success: function(data, textStatus) {
           //alert(data);
           if ( data != null & data!="")
        	   $("#mycode").text(editor.getValue(editor.setValue(data)));
        },
        complete : function(XMLHttpRequest, textStatus) {
        
		},
		error : function(XMLHttpRequest,textStatus,errorThrown) {
			alert("Error:"+textStatus);
			//alert(errorThrown.toString());
		}
    });	 
}

function readDocs(myfilename){
	$.ajax({
        type: "post",
        url: "../facade/readDocsFileFacade",
        data: {filename:myfilename},
        dataType: 'text',
        success: function(data, textStatus) {
           //alert(data);
           if ( data != null & data!="")
        	   $("#mycode").text(editor.getValue(editor.setValue(data)));
        },
        complete : function(XMLHttpRequest, textStatus) {
        
		},
		error : function(XMLHttpRequest,textStatus,errorThrown) {
			alert("Error:"+textStatus);
			//alert(errorThrown.toString());
		}
    });	 
}

function setCompleteSampleDemo(){
	readText("CompleteSample.sgs")
}

function setFinalSampleDemo(){
	readText("FinalSample.sgs")
}

function setFinalMagicDemo(){
	readText("FinalMagic.sgs")
}

function setCompleteAdvancedDemo(){
	readText("CompleteAdvanced.sgs")
}

function setCompleteOracleEnDemo(){
	readText("CompleteOracleEn.sgs")
}

function setGenerateSampleDemo(){
	readText("GenerateSample.sgs")
}

function setGenerateOracleDemo(){
	readText("GenerateOracle.sgs")
}

function setGenerateOracleAdvancedDemo(){
	readText("GenerateOracleAdvanced.sgs")
}

function setGenerateOracleAdvancedEnDemo(){
	readText("GenerateOracleAdvancedEn.sgs")
}

function setGenerateCallMagicDemo(){
	readText("GenerateCallMagic.sgs")
}

function setGenerateAdvancedDemo(){
	readText("GenerateAdvanced.sgs")
}

function setOneDemo(){
	readText("one.sgs")
}


function setUserSystemsDemo(){
	readText("usersystems.sgs")
}

function setUserSystemsOraclecDemo(){
	readText("usersystemsOracle.sgs")
}

function setMyProjectDemo(){
	readText("myproject.sgs")
}

function setDualLangBBSDemo(){
	readText("DualLangBBS.sgs")
}

function setReadme(){
	readDocs("Readme.txt")
}

function switchToExcel(){
	window.location.href="index.html";
}

function switchUrl(url){
	window.location.href=url;
}

function  checkUseCust(){
	if ($("#useAdvancedCustomize").get(0).checked==true){
		$.messager.confirm("警告", "高级定制可能使代码生成物通不过编译，确定使用？", function (data) {
		    if (data) {
		    	$("#useAdvancedCustomize").get(0).checked=true;
		    	$("#useCust").css("display","block");
		     }else {
		    	 $("#useAdvancedCustomize").get(0).checked=false;
		    	 $("#useCust").css("display","none");
		     }
		});
	}else{
		$("#useCust").css("display","none");
	}
}

function  checkUseUserPartial(){
	if ($("#useUserPartial").get(0).checked==true){
		$.messager.confirm("警告", "部分生成功能可能使代码生成物通不过编译，确定使用？", function (data) {
		    if (data) {
		    	$("#useUserPartial").get(0).checked=true;
		    	$("#usePartial").css("display","block");
		     }else {
		    	 $("#useUserPartial").get(0).checked=false;
		    	 $("#usePartial").css("display","none");
		     }
		});
	}else{
		$("#usePartial").css("display","none");
	}
}

function toggleAutoConfig(){
	if ($("#autoConfig").get(0).checked==true){
		$("#frontUseProjectName").attr("disabled","disabled");
		$("#frontUseControllerPrefix").attr("disabled","disabled");
	}else{
		$("#frontUseProjectName").removeAttr("disabled");
		$("#frontUseControllerPrefix").removeAttr("disabled");
	}
}
</script>
</html>